module AdminwebsitearticlesHelper
  def category_column(record) 
    if record.category.nil? 
      "" 
    else 
      record.category.name 
    end 
  end 


  # display the category column as a dropdown 
  def category_form_column(record,input_name) 
    options = Category.find(:all).collect do |c| 
      [ c.name, c.id ] 
    end 
    select :record, :category_id, options, 
           {:include_blank => false, :prefix => input_name}, 
           {:name => input_name + '[id]'} 
  end 
  

end
